﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/AdminCP/Views/Shared/ViewMasterPage1.Master"
    Inherits="System.Web.Mvc.ViewPage<InfoTech.Mvc.LanTranh.MucVu.Models.SOHONNHANModel>" %>

<%@ Import Namespace="InfoTech.LanTranh.MucVu.Service" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-box kethon">
        <a name="honnhan"></a>
        <div class="content-box-header">
            <h3>
                Cập Nhật Sổ Hôn Nhân
            </h3>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <%
                Html.EnableClientValidation(); %>
            <% 
                using (Html.BeginForm())
                {%>
            <%:Html.ValidationSummary()%>
            <%:Html.HiddenFor(c=>c.MAHONNHAN) %>
            <%:Html.HiddenFor(c=>c.TENCHA) %>
            <%:Html.HiddenFor(c=>c.TENME) %>
            <table cellspacing="3" cellpadding="3">
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Sổ Hôn Nhân số:
                    </td>
                    <td colspan="4">
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.MASO, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MASO, "(*)")%>
                        </div>
                    </td>
                    <td>
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Ngày
                    </td>
                    <td colspan="4">
                        <div class="editor-field">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <div class="editor-field">
                                            <%: Html.DropDownListFor(model => model.NGAY,GIAODANService.Get_List_Days(), new { style = "width: 140px", @class="text-input" })%>
                                            <%: Html.ValidationMessageFor(model => model.NGAY, "(*)")%>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="editor-field">
                                            <%: Html.DropDownListFor(model => model.THANG,GIAODANService.Get_List_Months(), new { style = "width: 145px", @class="text-input" })%>
                                            <%: Html.ValidationMessageFor(model => model.THANG, "(*)")%>
                                        </div>
                                    </td>
                                    <td>
                                        <div class="editor-field">
                                            <%: Html.DropDownListFor(model => model.NAM,GIAODANService.Get_List_Years(), new { style = "width: 135px", @class="text-input" })%>
                                            <%: Html.ValidationMessageFor(model => model.NAM, "(*)")%>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Anh
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.HiddenFor(model => model.MAGIAODAN_CHONG)%>
                            <%: Html.TextBoxFor(model => model.TENCHONG, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENCHONG, "(*)")%>
                        </div>
                    </td>
                    <td>
                        <img src="<%=Html.AreaImagesPath("AdminCP")%>search.png" style="cursor: pointer"
                            onclick="javascript:TimChong();" />
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Chị
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.HiddenFor(model => model.MAGIAODAN_VO)%>
                            <%: Html.TextBoxFor(model => model.TENVO, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENVO, "(*)")%>
                        </div>
                    </td>
                    <td>
                        <img src="<%=Html.AreaImagesPath("AdminCP")%>search.png" style="cursor: pointer"
                            onclick="javascript:TimVo();" />
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Con Ông
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.TENCHA_CHONG, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENCHA_CHONG, "(*)")%>
                        </div>
                    </td>
                    <td>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Con Ông
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.TENCHA_VO, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENCHA_VO, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Và Bà
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.TENME_CHONG, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENME_CHONG, "(*)")%>
                        </div>
                    </td>
                    <td>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Và Bà
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.TENME_VO, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENME_VO, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Tôn giáo
                    </td>
                    <td>
                        <div class="editor-field">
                            <%:Html.DropDownListFor(c=>c.MATONGIAO,TONGIAOService.Get_List(), new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MATONGIAO, "(*)")%>
                        </div>
                    </td>
                    <td>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Nhân Chứng 1
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.HiddenFor(model => model.MANHANCHUNG1)%>
                            <%: Html.TextBoxFor(model => model.TENNHANCHUNG1, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENNHANCHUNG1, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                        <img src="<%=Html.AreaImagesPath("AdminCP")%>search.png" style="cursor: pointer"
                            onclick="javascript:TimNhanChung1();" />
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        Nhân Chứng 2
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.HiddenFor(model => model.MANHANCHUNG2)%>
                            <%: Html.TextBoxFor(model => model.TENNHANCHUNG2, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENNHANCHUNG2, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                        <img src="<%=Html.AreaImagesPath("AdminCP")%>search.png" style="cursor: pointer"
                            onclick="javascript:TimNhanChung2();" />
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Tại
                    </td>
                    <td colspan="4">
                        <div class="editor-field">
                            <%: Html.TextBoxFor(model => model.DIACHI, new { style = "width: 545px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.DIACHI, "(*)")%>
                        </div>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Do Linh Mục
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.HiddenFor(model => model.MALINHMUC)%>
                            <%: Html.TextBoxFor(model => model.TENLINHMUC, new { style = "width: 200px", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.TENLINHMUC, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                        <img src="<%=Html.AreaImagesPath("AdminCP")%>search.png" style="cursor: pointer"
                            onclick="javascript:TimLinhMuc1();" />
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle" nowrap="nowrap">
                        Hiện Trạng Hôn nhân
                    </td>
                    <td>
                        <div class="editor-field">
                            <%:Html.DropDownListFor(c => c.MAHIENTRANGHONNHAN, HIENTRANGHONNHANService.Get_List(), new { style = "width: 200px", @class = "text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.MAHIENTRANGHONNHAN, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Không Lưu Sổ
                    </td>
                    <td>
                        <%:Html.CheckBoxFor(c=>c.LUUSO) %>
                    </td>
                    <td width="32">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="6">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="title" colspan="6">
                        Gỡ Rối Hôn Nhân
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="6">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Gỡ Rối Hôn Nhân
                    </td>
                    <td>
                        <div class="editor-field">
                            <%: Html.CheckBoxFor(c=>c.LYHON) %>
                            <%: Html.ValidationMessageFor(model => model.LYHON, "(*)")%>
                        </div>
                    </td>
                    <td width="32">
                        &nbsp;
                    </td>
                    <td align="right" class="cellTitle" valign="middle">
                    </td>
                    <td>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                        Ghi Chú
                    </td>
                    <td colspan="4">
                        <div class="editor-field">
                            <%: Html.TextAreaFor(model => model.GHICHU,5,50, new { style = "width: 545px;overflow: auto;", @class="text-input" })%>
                            <%: Html.ValidationMessageFor(model => model.GHICHU, "(*)")%>
                        </div>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="lineRow" colspan="6">
                    </td>
                </tr>
                <tr>
                    <td align="right" class="cellTitle" valign="middle">
                    </td>
                    <td colspan="4">
                        <input type="submit" value="Cập nhật" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
            <%
                }%>
        </div>
        <!-- End .content-box-content -->
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderCss" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderScript" runat="server">
    <script type="text/javascript" src="<%=Html.AreaScriptPath("AdminCP") %>MucVu.js"></script>
    <script language="javascript" type="text/javascript">
        function TimChong() {
            Dialog('<%=Url.Action("TimChong","GiaDinhCongGiao") %>', '', 'Kết Hôn Với', 1000, 335, HideDialog, ClearDataTimChong);
        }
        function ClearDataTimChong() {
            $('#MAGIAODAN_CHONG').val('');
            $('#TENCHONG').val('');
            ClearChaMeChong();
        }
        function ClearChaMeChong() {
            $('#TENCHA_CHONG').val('');
            $('#TENME_CHONG').val('');
        }
        function ReceiveChong(id, name) {
            $('#MAGIAODAN_CHONG').val(id);
            $('#TENCHONG').val(name);
            GetChaMeChong(id);
        }
        function GetChaMeChong(id) {
            $.post('<%=Url.Action("GetTenChaMe", "GiaDinhCongGiao") %>', { id: id },
            function (data) {
                $('#TENCHA_CHONG').val(data.cha);
                $('#TENME_CHONG').val(data.me);
            });
        }
        function TimVo() {
            Dialog('<%=Url.Action("TimVo","GiaDinhCongGiao") %>', '', 'Kết Hôn Với', 1000, 335, HideDialog, ClearDataTimVo);
        }
        function ClearDataTimVo() {
            $('#MAGIAODAN_VO').val('');
            $('#TENVO').val('');
            ClearChaMeVo();
        }
        function ClearChaMeVo() {
            $('#TENCHA_VO').val('');
            $('#TENME_VO').val('');
        }
        function ReceiveVo(id, name) {
            $('#MAGIAODAN_VO').val(id);
            $('#TENVO').val(name);
            GetChaMeVo(id);
        }
        function GetChaMeVo(id) {
            $.post('<%=Url.Action("GetTenChaMe", "GiaDinhCongGiao") %>', { id: id },
            function (data) {
                $('#TENCHA_VO').val(data.cha);
                $('#TENME_VO').val(data.me);
            });
        }
        function TimNhanChung1() {
            Dialog('<%=Url.Action("TimPhuThan2","GiaDinhCongGiao") %>', '', 'Nhân Chứng 1', 1000, 335, HideDialog, ClearDataNhanChung);
        }
        function TimNhanChung2() {
            Dialog('<%=Url.Action("TimPhuThan2","GiaDinhCongGiao",new {id=1}) %>', '1', 'Nhân Chứng 2', 1000, 335, HideDialog, ClearDataNhanChung);
        }
        function ReceiveNhanChung(type, id, value) {
            if (type) {
                $('#TENNHANCHUNG2').val(value);
                $('#MANHANCHUNG2').val(id);
            }
            else {
                $('#TENNHANCHUNG1').val(value);
                $('#MANHANCHUNG1').val(id);
            }
        }
        function ClearDataNhanChung(type) {
            if (type) {
                $('#TENNHANCHUNG2').val('');
                $('#MANHANCHUNG2').val('');
            }
            else {
                $('#TENNHANCHUNG1').val('');
                $('#MANHANCHUNG1').val('');
            }
        }
        function TimLinhMuc1() {
            Dialog('<%=Url.Action("TimLinhMuc1","GiaDinhCongGiao",new {id=ViewData["GENDERID"]}) %>', '', 'Tìm Linh Mục', 635, 300, HideDialog, ClearDataLinhMuc1);
        }
        function ReceiveLinhMuc1(id, value) {
            $('#TENLINHMUC').val(value);
            $('#MALINHMUC').val(id);
        }
        function ClearDataLinhMuc1() {
            $('#TENLINHMUC').val('');
            $('#MALINHMUC').val('');
        }
        $(document).ready(function () {
            $("#MAGIAOPHAN").change(function () {
                Change_GiaoPhan('kethon', '<%=Url.Action("Get_GIAOHAT","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MAGIAOHAT").change(function () {
                Change_GiaoHat('kethon', '<%=Url.Action("Get_GIAOXU","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
            $("#MAGIAOXU").change(function () {
                Change_GiaoXu('kethon', '<%=Url.Action("Get_GIAOHO","GiaDinhCongGiao",new {area="AdminCP"}) %>', this.value);
            });
        });
    </script>
</asp:Content>
